package com.turing.post.organization.util;

import java.math.BigInteger;
import java.util.List;

import javax.ejb.Local;
import javax.ejb.Remote;

import com.turing.post.util.PCPSApplicationException;
import com.turing.post.util.PCPSWebInput;

/**
 * 持卡人商户交易折扣/手续费策略DAO
 * 
 * @author yxb
 * 
 */
@Remote
@Local
public interface MerchantFeePolicyDao {
	/**
	 * 创建策略
	 * 
	 * @param mfp
	 *            持卡人商户交易折扣/手续费策略
	 * @throws PCPSApplicationException
	 */
	public void insert(MerchantFeePolicy mfp) throws PCPSApplicationException;
	
	/**
	 * 删除策略,状态为3时可执行
	 * @param mfp
	 * @throws PCPSApplicationException
	 */
	public void delete(MerchantFeePolicy mfp) throws PCPSApplicationException;
	
	/**
	 * 修改策略
	 * 
	 * @param mfp
	 *            持卡人商户交易折扣/手续费策略
	 * @throws PCPSApplicationException
	 */
	public void update(MerchantFeePolicy mfp) throws PCPSApplicationException;

	/**
	 * 根据主键查找策略
	 * 
	 * @param mfp
	 *            持卡人商户交易折扣/手续费策略
	 * @throws PCPSApplicationException
	 */
	public MerchantFeePolicy getMerchantFeePolicyByPolicyId(BigInteger mfpid);
	
	/**
	 * 锁定方式根据主键查找策略
	 * 
	 * @param mfp
	 *            持卡人商户交易折扣/手续费策略
	 * @throws PCPSApplicationException
	 */
	public MerchantFeePolicy getMerchantFeePolicyByPolicyIdForUpdate(BigInteger mfpid);
	
	/**
	 * 根据业务查找满足条件的策略集合
	 * 
	 * @param mfp
	 * @return
	 */
	public List<MerchantFeePolicy> getMerchantFeePolicyByBusiness(
			MerchantFeePolicy mfp);

	/**
	 * 根据条件查询 持卡人商户交易资费策略分页数据
	 * @param merchantNo
	 * @param businessType
	 * @param cardFaceId
	 * @param cardClassicId
	 * @param feeType
	 * @param status
	 * @param page
	 * @return
	 */
	public List<MerchantFeePolicy> getMrchFeePolicyByConditions(
			PCPSWebInput webinput, String merchantNo, String businessType,
			String cardFaceId, String cardClassicId, String feeType,
			String status, Integer page);
	
	/**
	 * 根据条件查询 持卡人商户交易资费策略 总数
	 * @param merchantNo
	 * @param businessType
	 * @param cardFaceId
	 * @param cardClassicId
	 * @param feeType
	 * @param status
	 * @return
	 */
	public BigInteger getMrchFeePolicyTotalByConditions(PCPSWebInput webinput,
			String merchantNo, String businessType, String cardFaceId,
			String cardClassicId, String feeType, String status);
}
